CONTENTS | INDEX | PREV | NEXT
 x.a

 NAME
  x.a - autoinit terminating tags

 SYNOPSIS

 FUNCTION
  The x.o module is the last object module in the link line DCC
  specifies to DLINK when linking an executable.  This module
  terminates the autoinit and autoexit sections with an RTS allowing
  the base of the section(s) to be called by the startup and exit
  code.

  autoinit/exit sections work as follows: Any object module may
  define a specially named section which will be linked, in sequence,
  with other module's sections of the same name.  These sections
  contain only code and NO RTS.  The terminating module X.O adds a
  single RTS to each section allowing the base of the section to be
  called by the startup/exit module (C.O), propogating through all
  autoinit/exit routines before hitting the RTS placed in the section
  by X.O

  DICE uses autoinit/exit sections to handle the following things:

  (1)     Code to initialize initialized data containing references to
      other initialized data (i.e.  int a, *b = &a;)  when the code
      must be made residentable.  This precludes the need for the
      startup code to handle Data-Data Reloc32's for resident code.

  (2)     Code to open libraries whos base variables are referenced but
      never declared.  _DOSBase and the various floating point
      libraries are automatically openned in this way whenever
      library calls to them are made.

      This precludes the need for DICE to have complex, room-
      consuming, and many times unncessary code in c.lib to
      handle these situations.

  (3)     Code to close libraries that were openned by (2) on exit.

  (4)     Entry points for the special __autoinit keyword 

 SEE ALSO
  c.a